
<!DOCTYPE html  [
    <!ENTITY nbsp "&#160;">]>
    <ui:composition template="/layout_dashboard.xhtml"
                    xmlns="http://www.w3.org/1999/xhtml"
                    xmlns:f="http://java.sun.com/jsf/core"
                    xmlns:h="http://java.sun.com/jsf/html"
                    xmlns:ui="http://java.sun.com/jsf/facelets"
                    xmlns:p="http://primefaces.org/ui">


        <ui:define name="Menu">

            <h:form id="form">
                <p:growl id="messages1" showDetail="true" />

                <p:contextMenu for="treeSingle">
                    <p:menuitem value="Add" update="treeSingle,messages1" actionListener="#{treeBean.addNode}" icon="ui-icon-search" />
                    <p:menuitem value="View" update="messages1" actionListener="#{treeBean.displaySelectedSingle}" icon="ui-icon-search" />
                </p:contextMenu>

                <p:tree id="treeSingle" value="#{treeBean.root}" var="node" 
                        selectionMode="single"
                        selection="#{treeBean.selectedNode}"
                        dynamic="true" >
                    <p:ajax event="select" update=":test" listener="#{treeBean.onNodeSelect}"/>  

                    <p:treeNode>
                        <h:outputText value="#{node}"/>
                    </p:treeNode>
                </p:tree>
            </h:form>

        </ui:define>
        <ui:define name="TopBar">
            <ul>
                <li><a href="../home.xhtml">Homepage</a></li>
                <li><a href="../dashboard/dashboardtutor.xhtml">Dashboard</a></li>
                <li class="current_page_item"><h:form><h:commandLink value="Add Course" action="#{treeBean.clear()}"/></h:form>
                </li>


            </ul>

        </ui:define>



        <ui:define name="Content">
            <h:panelGroup id="test" layout="block" style="width: 680px; float: right; padding-top: 30px" >
                <p:panel>
                    <ui:include src="#{treeBean.pageToInclude}Create_perso.xhtml" />
                </p:panel>
            </h:panelGroup>
        </ui:define>
    </ui:composition>